#pragma once 

#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<string.h>
#include<stdlib.h>

#define SIZE 4094

#define None_Flush 1
#define Full_Flush (1<<1)
#define Line_Flush (1<<2)

typedef struct myfile{
    int fileno;
    int pos;
    int cap;
    int flush_mode;
    char buff[SIZE];
}myfile;

myfile* my_fopen(const char* path, const char* mode);
void my_fclose(myfile* fp);
int my_fwrite(myfile* fp, const char* str, int size);
void my_fflush(myfile* fp);
void print_buff(myfile* fp);

